// 命名空间
var huzi = {};


// 所有代码
huzi.subPath = 'modules/main/huzi/';
huzi.srcPath= huzi.subPath + 'src/';
huzi.resPath= huzi.subPath + 'res/';

// 所有代码
huzi.src = [
    huzi.srcPath+'SubCreateRoomWindow.js',
    huzi.srcPath+'SubGameLayer.js',
    huzi.srcPath+'paohuziUtils.js',
    huzi.srcPath+'Card.js',
    huzi.srcPath+'CardSelect.js',
    huzi.srcPath+'ChiBiLayer.js',
    huzi.srcPath+'ComboInfo.js',
    huzi.srcPath+'OpenCards.js',
    huzi.srcPath+'OutCards.js',
    huzi.srcPath+'PhzJieSuan.js',
    huzi.srcPath+'PhzLayer.js',
    huzi.srcPath+'PhzRoomQuit.js',
    huzi.srcPath+'PhzZongJieSuan.js',
    huzi.srcPath+'ReplayData.js',
    huzi.srcPath+'PlayerBackLayer.js'
];

// 所有资源
huzi.res = {
    CreateRoomWindow_json: huzi.resPath+'CreateRoomWindow.json',

    //ccs
    PhzChiBiLayer_json: huzi.resPath+'PhzChiBiLayer.json'
    , PhzComboInfo_json: huzi.resPath+'PhzComboInfo.json'
    , PhzJieSuan_json: huzi.resPath+'PhzJieSuan.json'
    , PhzJieSuanFour_json: huzi.resPath+'PhzJieSuanFour.json'
    , PhzJieSuanTwo_json: huzi.resPath+'PhzJieSuanTwo.json'
    , PhzPlayerBackLayer_json: huzi.resPath+'PhzPlayerBackLayer.json'
    , PhzRoomFourPlayer_json: huzi.resPath+'PhzRoomFourPlayer.json'
    , PhzRoomQuit_json: huzi.resPath+'PhzRoomJieSan.json'
    , PhzRoomLayer_json: huzi.resPath+'PhzRoomLayer.json'
    , PhzRoomThreeplayer_json: huzi.resPath+'PhzRoomThreeplayer.json'
    , PhzRoomTwoplayer_json: huzi.resPath+'PhzRoomTwoplayer.json'
    , PhzZongJieSuan_json: huzi.resPath+'PhzZongJieSuan.json'
    , PlayerInfo_Phz_json: huzi.resPath+'PlayerInfo_phz.json'

    // animation
    , Phz_fanxingAni: huzi.resPath+'PhzFanXing.json'
    , Phz_genxingAni: huzi.resPath+'PhzGenXing.json'
    , PhzHead_json: huzi.resPath+'PhzHead.json'
    , PhzHu_json: huzi.resPath+'PhzHu.json'
    , PhzShou_json: huzi.resPath+'PhzShou.json'

    // 动画
    , CHZ_chi_json: huzi.resPath+'animation/CHZ_chi.json'
    , CHZ_guoxiao_json: huzi.resPath+'animation/CHZ_guoxiao.json'
    , CHZ_pao_json: huzi.resPath+'animation/CHZ_pao.json'
    , CHZ_peng_json: huzi.resPath+'animation/CHZ_peng.json'
    , CHZ_qing_json: huzi.resPath+'animation/CHZ_qing.json'
    , CHZ_xiao_json: huzi.resPath+'animation/CHZ_xiao.json'

    // image
    , card_common_plist: huzi.resPath+'dynamicRes/card_common.plist'
    , card_common_png: huzi.resPath+'dynamicRes/card_common.png'
    , card_plist: huzi.resPath+'dynamicRes/card.plist'
    , card_png: huzi.resPath+'dynamicRes/card.png'
    , hand_plist: huzi.resPath+'dynamicRes/hand.plist'
    , hand_png: huzi.resPath+'dynamicRes/hand.png'
    , nextju_png: huzi.resPath+'dynamicRes/nextju.png'
    , redquan_png: huzi.resPath+'dynamicRes/redquan.png'
    , greenquan_png: huzi.resPath+'dynamicRes/greenquan.png'
    , eff_spark_png: huzi.resPath+'dynamicRes/eff_spark.png'

    , roomjiesan_no_png: huzi.resPath+'PhzRoomJieSan/roomjiesan_no.png'
    , roomjiesan_ok_png: huzi.resPath+'PhzRoomJieSan/roomjiesan_ok.png'
    , roomjiesan_wait_png: huzi.resPath+'PhzRoomJieSan/roomjiesan_wait.png'

    , eff_weiSay: huzi.resPath+'dynamicRes/eff_weiSay.png'
    , finger_export: huzi.resPath+'dynamicRes/finger.ExportJson'
    , finger_plist: huzi.resPath+'dynamicRes/finger0.plist'
    , finger_png: huzi.resPath+'dynamicRes/finger0.png'
    , PhzLizi_json: huzi.resPath+'dynamicRes/animation/MJ_lizi09.plist'
    , chiSay: huzi.resPath+'dynamicRes/chiSay.png'
    , cweiSay: huzi.resPath+'dynamicRes/cweiSay.png'
    , guosaoSay: huzi.resPath+'dynamicRes/guosaoSay.png'
    , huSay: huzi.resPath+'dynamicRes/huSay.png'
    , kaiduoSay: huzi.resPath+'dynamicRes/kaiduoSay.png'
    , paoSay: huzi.resPath+'dynamicRes/paoSay.png'
    , pengSay: huzi.resPath+'dynamicRes/pengSay.png'
    , saochuanSay: huzi.resPath+'dynamicRes/saochuanSay.png'
    , saoSay: huzi.resPath+'dynamicRes/saoSay.png'
    , tiSay_yz: huzi.resPath+'dynamicRes/tiSay_yz.png'
    , tiSay: huzi.resPath+'dynamicRes/tiSay.png'
    , weiSay_yz: huzi.resPath+'dynamicRes/weiSay_yz.png'
    , weiSay: huzi.resPath+'dynamicRes/weiSay.png'
    , genxing: huzi.resPath+'dynamicRes/result/genxing.png'
    , fanxing: huzi.resPath+'dynamicRes/result/fanxing.png'

    , huzi_ting_fnt: huzi.resPath+'dynamicRes/tishi/num.fnt'
    , huzi_ting_png: huzi.resPath+'dynamicRes/tishi/num.png'

    , tingmark_png: huzi.resPath+'dynamicRes/tishi/mark_jiao.png'
    , jianmark_png: huzi.resPath+'dynamicRes/tishi/mark_jian.png'

    , huziTing_png: huzi.resPath+'dynamicRes/tishi/huzi_ting.png'
    , table_third_0_png: huzi.resPath+'dynamicRes/table_third_0.png'

    , table_back_0_jpg: huzi.resPath+'dynamicRes/table_back0.jpg'
    , table_back_1_jpg: huzi.resPath+'dynamicRes/table_back1.jpg'
    , table_back_2_jpg: huzi.resPath+'dynamicRes/table_back2.jpg'
    , table_back_3_jpg: huzi.resPath+'dynamicRes/table_back3.jpg'

    // 信号资源
    , signal1: huzi.resPath+'dynamicRes/signal1_1.png'
    , signal2: huzi.resPath+'dynamicRes/signal1_2.png'
    , signal3: huzi.resPath+'dynamicRes/signal1_3.png'
    , signal4: huzi.resPath+'dynamicRes/signal1_4.png'
    , signal5: huzi.resPath+'dynamicRes/signal1_5.png'
    // 电池资源
    , battery_1: huzi.resPath+'dynamicRes/battery1.png'
    , battery_2: huzi.resPath+'dynamicRes/battery2.png'
    , battery_3: huzi.resPath+'dynamicRes/battery3.png'
    , battery_4: huzi.resPath+'dynamicRes/battery4.png'
    , battery_5: huzi.resPath+'dynamicRes/battery5.png'

    // 新吃碰过胡
    , sp_zi_tx_json: huzi.resPath+'dynamicRes/spine/zi_tx.json'
    , sp_zi_tx_atlas: huzi.resPath+'dynamicRes/spine/zi_tx.atlas'
    , sp_zi_tx_png: huzi.resPath+'dynamicRes/spine/zi_tx.png'
    , sp_zi_tx2_png: huzi.resPath+'dynamicRes/spine/zi_tx2.png'

    , btn_new_guo: huzi.resPath+'dynamicRes/image/btn_new_guo.png'
    , btn_old_guo: huzi.resPath+'dynamicRes/image/btn_old_guo.png'

    , transparent_97x99_png: huzi.resPath+'image/transparent_97x99.png'

    // font
    , jushu_fnt: huzi.resPath+'PhzRoomLayer/jushu.fnt'

    // sound
    , paohuzi_vbi_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_bi.mp3'
    , paohuzi_vchi_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_chi.mp3'
    , paohuzi_vhu_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_hu.mp3'
    , paohuzi_vpao_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_pao.mp3'
    , paohuzi_vpeng_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_peng.mp3'
    , paohuzi_vti_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_ti.mp3'
    , paohuzi_vwei_1: huzi.resPath+'dynamicRes/sound_mp3/putonghua/n_wei.mp3'
    , paohuzi_vbi_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_bi.mp3'
    , paohuzi_vchi_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_chi.mp3'
    , paohuzi_vhu_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_hu.mp3'
    , paohuzi_vpao_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_pao.mp3'
    , paohuzi_vpeng_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_peng.mp3'
    , paohuzi_vti_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_ti.mp3'
    , paohuzi_vwei_2: huzi.resPath+'dynamicRes/sound_mp3/putonghua/v_wei.mp3'

    , getw: huzi.resPath+'dynamicRes/sound_mp3/getw.mp3'//小胜利
    , yin_win: huzi.resPath+'dynamicRes/sound_mp3/yin_win.mp3'//大胜利
    , huangz: huzi.resPath+'dynamicRes/sound_mp3/huangz.mp3'

    , vCountDown: huzi.resPath+'dynamicRes/sound_mp3/audio_countdown.mp3'
    , vCountDown_1: huzi.resPath+'dynamicRes/sound_mp3/audio_countdown.mp3'
    , vCountDown_2: huzi.resPath+'dynamicRes/sound_mp3/audio_countdown.mp3'
};

var soundExt = '.mp3';

for (var i = 1; i <= 20; i++) {
    huzi.res['huzi_ting_' + i] = huzi.resPath+'dynamicRes/tishi/huzi_ting_' + i + '.png';
}

//普通话音效
for (var i = 1; i <= 20; i++) {
    huzi.res['paohuzi_v' + i + '_1'] = huzi.resPath+'dynamicRes/sound_mp3/putonghua/n' + i + soundExt;
}
for (var i = 1; i <= 20; i++) {
    huzi.res['paohuzi_v' + i + '_0'] = huzi.resPath+'dynamicRes/sound_mp3/putonghua/v' + i + soundExt;
    huzi.res['paohuzi_v' + i + '_2'] = huzi.resPath+'dynamicRes/sound_mp3/putonghua/v' + i + soundExt;
}

var dialect_res = dialect_res || {};

// sound
dialect_res['paohuzi_vzimo_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_zimo.mp3';
dialect_res['paohuzi_vzimo_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_zimo.mp3';
dialect_res['paohuzi_vzimo_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_zimo.mp3';
dialect_res['paohuzi_vjushou_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_jushou.mp3';
dialect_res['paohuzi_vjushou_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_jushou.mp3';
dialect_res['paohuzi_vjushou_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_jushou.mp3';
dialect_res['paohuzi_vbi_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_bi.mp3';
dialect_res['paohuzi_vchi_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_chi.mp3';
dialect_res['paohuzi_vhu_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_hu.mp3';
dialect_res['paohuzi_vpao_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_pao.mp3';
dialect_res['paohuzi_vpeng_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_peng.mp3';
dialect_res['paohuzi_vti_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_ti.mp3';
dialect_res['paohuzi_vwei_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n_wei.mp3';
dialect_res['paohuzi_vbi_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_bi.mp3';
dialect_res['paohuzi_vbi_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_bi.mp3';
dialect_res['paohuzi_vchi_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_chi.mp3';
dialect_res['paohuzi_vchi_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_chi.mp3';
dialect_res['paohuzi_vhu_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_hu.mp3';
dialect_res['paohuzi_vhu_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_hu.mp3';
dialect_res['paohuzi_vpao_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_pao.mp3';
dialect_res['paohuzi_vpao_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_pao.mp3';
dialect_res['paohuzi_vpeng_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_peng.mp3';
dialect_res['paohuzi_vpeng_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_peng.mp3';
dialect_res['paohuzi_vti_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_ti.mp3';
dialect_res['paohuzi_vti_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_ti.mp3';
dialect_res['paohuzi_vwei_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_wei.mp3';
dialect_res['paohuzi_vwei_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v_wei.mp3';

//跑胡子
for (var i = 1; i <= 20; i++) {
    dialect_res['paohuzi_v' + i + '_1'] = huzi.resPath+'dynamicRes/sound_mp3/cd/n' + i + soundExt;
}
for (var i = 1; i <= 20; i++) {
    dialect_res['paohuzi_v' + i + '_2'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v' + i + soundExt;
    dialect_res['paohuzi_v' + i + '_0'] = huzi.resPath+'dynamicRes/sound_mp3/cd/v' + i + soundExt;
}

huzi.wanfaMaps = {
    LEIYANGZIPAI: {
        mapid: app.map_id.LEIYANGZIPAI
    },
    LEIYANGZIPAI_2: {
        mapid: app.map_id.LEIYANGZIPAI
    },
    HENGYANGLHQ: {
        mapid: app.map_id.HENGYANGLHQ
    },
    HENGYANGSHK: {
        mapid: app.map_id.HENGYANGSHK
    },
};

huzi.wanfaTitle = {};

huzi.dialect_res = {};

// 创建房间左侧玩法列表间隙
huzi.btn_list_clearance = 10;

huzi.create_room_tabData = {
    btn_1: {
        click: ['mapid_0'],
        show: ['word_rsxz'],
        hide: ['fengding', 'word_rsxz2', 'word_wanfa', 'word_qihu'],
    },
    btn_2: {
        click: ['mapid_1'],
        show: ['fengding', 'word_rsxz2', 'word_wanfa'],
        hide: ['word_rsxz', 'word_qihu'],
    },
    btn_3: {
        click: ['mapid_2'],
        show: ['word_rsxz2', 'word_wanfa'],
        hide: ['word_rsxz', 'fengding', 'word_qihu'],
    },
    btn_4: {
        click: ['mapid_3'],
        show: ['word_rsxz2', 'word_wanfa'],
        hide: ['fengding', 'word_rsxz'],
    },
};

/**
 * 跑得快玩法选项
 * @type {*[]}
 */
huzi.create_room_wanFaData = [
    ['mapid',
        [
            ['耒阳字牌', app.map_id.LEIYANGZIPAI, -1000, -1000, true, true, false],
            ['衡阳六胡抢', app.map_id.HENGYANGLHQ, -1000, -1000, true, true, false],
            ['衡阳十胡卡', app.map_id.HENGYANGSHK, -1000, -1000, true, true, false],
            ['耒阳二人玩', app.map_id.LEIYANGZIPAI, -1000, -1000, true, true, false]
        ]
    ],
    ['jushu',
        [
            ['8局', 8, 435, 495, true, true, false, null, ['mapid_0', 'mapid_1', 'mapid_3']],
            ['16局', 16, 870, 495, false, true, false, null, ['mapid_0', 'mapid_1', 'mapid_3']]
        ]
    ],
    ['jushu2',
        [
            ['10局', 10, 435, 495, true, true, false, null, ['mapid_2']],
            ['16局', 16, 870, 495, false, true, false, null, ['mapid_2']]
        ]
    ],

    ['aatype',
        [
            ['房主承包', null, 435, 580, true, true, false, null]
        ]
    ],
    ['sanrenwan',
        [
            ['三人玩', true, 435, 410, true, true, false, null, ['mapid_0']],
        ]
    ],
    ['sanrenwan_1',
        [
            ['三人玩', true, 870, 580, true, true, false, null, ['mapid_2']]
        ]
    ],
    ['sirenwan',
        [
            ['四人玩', true, 870, 580, true, true, false, null, ['mapid_1']]
        ]
    ],
    ['erren',
        [
            ['二人玩', true, 870, 580, true, true, false, null, ['mapid_3']]
        ]
    ],

    ['jushou',
        [
            ['举手做声', true, 435, 325, false, false, false, null, ['mapid_0', 'mapid_3']]
        ]
    ],
    ['Wuhu',
        [
            ['不带无胡', false, 870, 325, false, false, false, null, ['mapid_0']]
        ]
    ],
    ['Yidianhong',
        [
            ['不带一点红', false, 435, 250, false, false, false, null, ['mapid_0', 'mapid_3']]
        ]
    ],

    //衡阳六胡抢
    ['o1510',
        [
            ['一五十', true, 435, 325, false, false, false, null, ['mapid_1', 'mapid_2']]
        ]
    ],
    ['subWanfa',
        [
            ['红黑点', 'honghei', 870, 325, false, false, false, null, ['mapid_1']]
        ]
    ],
    ['mingwei',
        [
            ['明偎', true, 435, 250, false, false, false, null, ['mapid_1', 'mapid_2']]
        ]
    ],
    ['checkIp',
        [
            ['同IP检测', true, 655, 250, false, false, false, null, ['mapid_1', 'mapid_2']]
        ]
    ],
    ['checkIp_2',
        [
            ['同IP检测', true, 435, 185, true, false, false, null, ['mapid_0']],
            ['同IP检测', true, 870, 250, true, false, false, null, ['mapid_3']]
        ]
    ],
    ['difen',
        [
            ['底分两分', 'jia1', 870, 250, false, false, false, null, ['mapid_1']],
            ['底分两分', 'jia1', 870, 325, false, false, false, null, ['mapid_2']]
        ]
    ],
    ['maxJi',
        [
            ['10分', 10, 435, 185, false, true, false, null, ['mapid_1']],
            ['20分', 20, 655, 185, false, true, false, null, ['mapid_1']],
            ['不封顶', 0, 870, 185, true, true, false, null, ['mapid_1']]
        ]
    ],
    ['Fanxing',
        [
            ['翻醒', 'fan', 435, 410, false, true, false, null, ['mapid_1', 'mapid_2']],
            ['跟醒', 'gen', 655, 410, true, true, false, null, ['mapid_1', 'mapid_2']],
            ['不带醒', '', 870, 410, false, true, false, null, ['mapid_1', 'mapid_2']]
        ]
    ],
    ['Chibian',
        [
            ['吃边打边', true, 870, 250, false, false, false, null, ['mapid_0']],
            ['吃边打边', true, 870, 325, false, false, false, null, ['mapid_3']]
        ]
    ],
    ['sipai',
        [
            ['抽牌20张', true, 435, 410, true, true, false, null, ['mapid_3'], ['LeastHuxi_0', 'LeastHuxi_1']]
        ]
    ],
    // ['LeastHuxi',
    //     [
    //         ['18胡', 18, 435, 185, true, true, false, null, ['mapid_3']],
    //         ['21胡', 21, 860, 185, false, true, false, null, ['mapid_3']]
    //     ]
    // ]
];

/**
 * 混桌适配文件
 * @type {Object}
 */
huzi.club_hunzhuo = {
    'btn_1': {
        'hide': ['sanrenwan_pdk', 'liangren_pdk'],
        'view': ['wanjiarenshu0', 'wanjiarenshu1'],
    }
};

huzi.fangka = {
    btn_1: [[5, 10], [3, 5]],
    btn_2: [[5, 10], [3, 5]],
    btn_3: [[5, 10], [3, 5]],
    btn_4: [[5, 10], [3, 5]],
    // btn_2: [[0, 0, 3, 4, 8], [0, 0, 1, 1, 1]]
};
